Skip to content

Skip unrelated OEM hardware leaves by DMI vendor - #21997

Open
emirb wants to merge 2 commits into
quattrofrom
perf/skip-unrelated-oem-leaves
Open

emirb wants to merge 2 commits into
quattrofrom
perf/skip-unrelated-oem-leaves

Conversation

@emirb

@emirb emirb commented Dec 6, 2026 •

Copy link
Copy Markdown
Contributor

What changes

During install and hardware setup, run_logged already skips leaves belonging to other architectures via omarchy_leaf_platform. On x86 and Qualcomm installs, every machine still runs dozens of unrelated OEM leaves (Acer, Apple, ASUS, Dell, Framework 16, HP, Lenovo, Microsoft Surface, Razer, Samsung), paying logging and probe overhead on hardware that cannot match.

Add omarchy_leaf_vendor next to omarchy_leaf_platform in install/helpers/logging.sh and check it in omarchy_skip_leaf. Read sys_vendor, board_vendor, and top-level device-tree compatible strings (/proc/device-tree/compatible or /sys/firmware/devicetree/base/compatible) once per process and skip strictly OEM-specific leaves when the combined identity is non-empty and does not match.

  • install/hardware/all.sh stays pure run_logged lines so image builds still enumerate every leaf.
  • Empty or unreadable DMI and device-tree identity skips nothing.
  • Device-tree-matched ARM leaves (such as Surface Laptop 7 and Galaxy Book4 Edge 14) stay eligible even when DMI contains placeholder strings.
  • Leaves that match generic hardware rather than an OEM (such as user/hardware/framework/fix-f13-amd-audio-input.sh, which probes any AMD Family 17h/19h PipeWire card) are not gated.

How it was tested

  • Added tests in test/shell.d/pkg-drop-test.sh covering positive keep cases for all ten vendor rules, placeholder-DMI + device-tree keep cases (/proc/device-tree/compatible and /sys/firmware/devicetree/base/compatible), board-vendor fallback, non-DMI AMD audio retention, and cross-vendor skips on x86 and Qualcomm.
  • Ran pkg-drop-test.sh, hw-platform-test.sh, hw-match-device-tree-test.sh, image-target-platform-test.sh, apply-lock-test.sh, dgx-spark-boot-test.sh, and platform-setup-test.sh under Bash 5.3 plus shellcheck -s bash -S warning.

Not checked: bare-metal hardware runs across every listed OEM.

Hardware setup runs dozens of vendor-specific leaves on every machine
even when DMI identifies a completely different manufacturer. Each leaf
still logs, forks, and probes sysfs or helper scripts before returning.

Add omarchy_leaf_vendor alongside omarchy_leaf_platform in
install/helpers/logging.sh so omarchy_skip_leaf skips strictly
OEM-specific leaves (Acer, Apple, ASUS, Dell, Framework 16, HP, Lenovo,
Microsoft Surface, Razer, Samsung) when sys_vendor and board_vendor are
readable and do not match. Missing or empty DMI fails open and skips
nothing, and install/hardware/all.sh stays pure run_logged lines so
image builds still enumerate every leaf.
@greptile-apps

greptile-apps Bot commented Dec 6, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge; no actionable defects were established.

Summary

Adds vendor checks before hardware setup scripts run, while preserving platform checks and full image-build enumeration.

  • Setup skips maker-specific fixes that do not match the machine.

Reviews (2) · Last reviewed commit: "Include device-tree compatible strings i..." · Reviewed by Greptile

@omarchybot omarchybot added the enhancement New feature or request label Dec 6, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Recommend: Hold — the author should keep device-tree-matched setup eligible when DMI vendor data is inconclusive.

At install/helpers/logging.sh:203, nonempty placeholder or unmatched DMI can skip the Surface Laptop 7 initramfs step before its device-tree check runs. That step enables the built-in keyboard at disk unlock. Please add a keep case for a matching device with inconclusive DMI, plus positive coverage for the retained vendor rules.

GitHub CI passed. Worker verification is pending. Source reviewed by Codex High, Opus 5.5 High and muse-wonder via pi, thinking high.

Qualcomm laptops such as Surface Laptop 7 match their hardware leaves
through /proc/device-tree/compatible rather than DMI. If a machine
reports nonempty placeholder DMI strings like "Default string",
omarchy_skip_leaf could skip those leaves before the device-tree check
ran.

Read /proc/device-tree/compatible (or the sysfs devicetree fallback,
honoring unprivileged OMARCHY_PROC_ROOT and OMARCHY_SYS_ROOT test
fixtures) once into _omarchy_hw_vendor alongside sys_vendor and
board_vendor using Bash mapfile with zero extra forks. Add keep cases
for placeholder DMI with device-tree matching plus positive coverage
for every vendor rule in omarchy_leaf_vendor.
@omarchybot

Copy link
Copy Markdown
Collaborator

Recommend: Hold — the author should preserve hardware setup when vendor data is inconclusive and fix the root-only fixture failure.

The revision keeps the Surface and Samsung device-tree matches eligible. At install/helpers/logging.sh:226, placeholder-only DMI with no device-tree identity still skips vendor steps before their model checks can run. For example, the HP ZBook sleep fix checks the DMI product name, which can match even when vendor fields contain placeholders. Please treat those placeholders as missing.

The vendor assertions at test/shell.d/pkg-drop-test.sh:290 and :299 expect opposite results from the Dell and Apple fixtures. Under root both calls read the same live identity, so one of the assertions must fail. Run that fixture block unprivileged or scope a root guard to it.

GitHub CI passed. Triage preflight blocked ISO-worker verification. Codex High traced the root-only test failure. Opus 5.5 High and muse-wonder via pi (high) reviewed the revision, and muse-wonder identified the remaining placeholder case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants